<template>
    <div>
        <script :id=id type="text/plain"></script>
    </div>
</template>
<script>
    import '../../../../static/ue/ueditor.config.js'
    import '../../../../static/ue/ueditor.all.min.js'
    import '../../../../static/ue/lang/zh-cn/zh-cn.js'
    import '../../../../static/ue/ueditor.parse.min'
    export default {
        name: 'ue',
        data () {
            return {
                editor: null
            }
        },
        props: {
            config: {
                type: Object
            },
            id: {
                type: String
            },
            content: {
                type: String
            }
        },
        mounted () {
            this._initEditor()
        },
        methods: {
            _initEditor () { // 初始化
                this.editor = UE.getEditor(this.id,this.config)
            },
            getUEContent () { // 获取含标签内容方法
                return this.editor.getContent()
            },
            setUEContent(str){
                return this.editor.setContent(str)
            }
        },
        destroyed () {
            this.editor.destroy()
        }
    }
</script>